package com.cursoandroid;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;

public class DatosActivity extends Activity {
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		InputStream is = getResources().openRawResource(R.raw.datos);
		
		InputStreamReader reader =  new InputStreamReader(is);
		BufferedReader file = new BufferedReader(reader);
		
		try {
			Toast.makeText(this, file.readLine(),Toast.LENGTH_LONG).show();
			file.close();reader.close();is.close();
		} catch (IOException e) {
			Log.d("datos", "Error al leer", e);
			e.printStackTrace();
		} 
	}
}